<!--
  - Copyright (c) 2018.
  - 北京九思金信科技有限公司对该文件内容保留所有权利。
  - 未经许可，不得私自拷贝、传播、发布、引用该文件内容，违者将被追究法律责任。
  -->

<template>
  <div class="CMAddIndex_box">
    <div class="CMAddIndex_title">
      <div class="CMAddIndex_title_return" @click="returnHistiy">
        <img src="@/pages/mobile/assets/img/Back@3x.png" alt>
        <span>返回</span>
      </div>
      <p>新建客户</p>
    </div>
    <div class="CMAddIndex_content">
      <div class="CMAddIndex_content_item">
        <div class="item_img_right item_img_right_active">
          <i>推荐</i>
        </div>
        <img src="@/pages/mobile/assets/img/cmadd_zn.png" alt>
        <h3>智能新增客户</h3>
      </div>
      <div class="CMAddIndex_content_item" @click="addCm(2)">
        <div class="item_img_right">
          <i>推荐</i>
        </div>
        <img src="@/pages/mobile/assets/img/cmadd_qy.png" alt>
        <h3>新建企业客户</h3>
      </div>
      <div class="CMAddIndex_content_item" @click="addCm(3)">
        <div class="item_img_right">
          <i>推荐</i>
        </div>
        <img src="@/pages/mobile/assets/img/cmadd_gr.png" alt>
        <h3>新建个人客户</h3>
      </div>
    </div>
    <transition name="slide-left">
      <cm-add-list ref="addlist" class="cmaddlist_box" v-show="addCmInfo"></cm-add-list>
    </transition>
  </div>
</template>

<script>
import CmAddList from "./CmAddList.vue";
export default {
  name: "cmAddIndex",
  data() {
    return {
      addCmInfo: false,
      addCmInfoIndex: ""
    };
  },
  components: {
    CmAddList
  },
  methods: {
    returnHistiy() {
      setTimeout(() => {
        
      }, timeout);
      this.$router.goBack();
    },
    addCm(index) {
      // this.addCmInfoIndex = index;
      this.$refs.addlist.loadInfo(index);
      this.addCmInfo = true;
    }
  }
};
</script>

<style scoped lang="less">
.CMAddIndex_box {
  position: fixed;
  z-index: 300;
  width: 100%;
  height: 100%;
  background: #fbf9fe;
  overflow: hidden;
  .CMAddIndex_title {
    width: 100%;
    height: 0.44rem;
    text-align: center;
    line-height: 0.44rem;
    background: #ffffff;
    position: fixed;
    z-index: 201;
    box-shadow: inset 0 -1px 0 0 rgba(207, 207, 207, 0.2);
    .CMAddIndex_title_return {
      margin-top: -0.04rem;
      float: left;
      img {
        // width: 0.15rem;
        height: 0.205rem;
        padding-left: 0.085rem;
        padding-top: 0.02rem;
      }
      span {
        font-family: Regular;
        font-size: 0.17rem;
        color: #3e3e3e;
        letter-spacing: -0.41px;
        line-height: 0.22rem;
      }
    }
    p {
      font-family: PingFangSC-Semibold;
      font-size: 0.17rem;
      color: #3e3e3e;
      letter-spacing: -0.41px;
      text-align: center;
      height: 0.44rem;
      font-weight: 700;

      line-height: 0.44rem;
      margin-left: 0.7rem;
      margin-right: 0.7rem;
    }
  }
  .CMAddIndex_content {
    margin-top: 0.5rem;
    .CMAddIndex_content_item {
      margin: 0.1rem 0.16rem 0rem 0.16rem;
      box-shadow: 0 2px 0.08rem 0 rgba(0, 0, 0, 0.06);
      border-radius: 0.05rem;
      overflow: hidden;
      height: 1.24rem;
      img {
        float: left;
        height: 1.24rem;
        margin-top: 0.1rem;
        margin-left: -0.08rem;
      }
      h3 {
        font-family: PingFangSC-Regular;
        font-size: 0.18rem;
        color: rgba(0, 22, 22, 0.85);
        letter-spacing: 0;
        margin-left: 47%;
        margin-top: 0.5rem;
        height: 0.25rem;
        line-height: 0.25rem;
      }
      .item_img_right {
        display: none;
      }
      .item_img_right_active {
        display: block;
        float: right;
        background: #ffdfdc;
        width: 0.5rem;
        height: 0.2rem;
        overflow: hidden;
        border-bottom-left-radius: 5px;
        i {
          display: block;
          font-family: PingFangSC-Regular;
          font-size: 0.12rem;
          color: #e03838;
          letter-spacing: 0;
          box-sizing: border-box;
          text-align: center;
        }
      }
    }
    .CMAddIndex_content_item:nth-child(1) {
      background: #ffffff
        url("@/pages/mobile/assets/img/cmadd3.png") no-repeat
        80% center;
      background-size: 50% 70%;
    }
    .CMAddIndex_content_item:nth-child(2) {
      background: #ffffff
        url("@/pages/mobile/assets/img/cmadd2.png") no-repeat
        80% center;
      background-size: 50% 70%;
    }
    .CMAddIndex_content_item:nth-child(3) {
      background: #ffffff
        url("@/pages/mobile/assets/img/cmadd1.png") no-repeat
        no-repeat 75% center;
      background-size: 50% 70%;
    }
  }
  .cmaddlist_box {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.377s ease;
    box-sizing: border-box;
    overflow: hidden;
  }
  .slide-left-enter,
  .slide-right-leave-active {
    opacity: 0;
    -webkit-transform: translate(50px, 0);
    transform: translate(50px, 0);
  }

  .slide-left-leave-active,
  .slide-right-enter {
    opacity: 0;
    -webkit-transform: translate(-50px, 0);
    transform: translate(-50px, 0);
  }
}
</style>
